package com.shahe.GirlsDay.util;

import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;

public class ContactPerson {
	private int contactid = 0;
	private String contactname = " ";
	private String relationship = " ";
	private String phone = " ";
	private String email = " ";
	private int userid = 0;

	public ContactPerson() {
	}

	public ContactPerson(JSONObject json) throws JSONException {
		this.contactid = json.getInt("contactid");
		this.contactname = json.getString("contactname");
		this.relationship = json.getString("relationship");
		this.phone = json.getString("phone");
		this.email = json.getString("email");
		this.userid = json.getInt("userid");
	}

	public int getContactid() {
		return contactid;
	}

	public void setContactid(int contactid) {
		this.contactid = contactid;
	}

	public String getContactname() {
		return contactname;
	}

	public void setContactname(String contactname) {
		this.contactname = contactname;
	}

	public String getRelationship() {
		return relationship;
	}

	public void setRelationship(String relationship) {
		this.relationship = relationship;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getUserid() {
		return userid;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	public JSONObject toJson() throws JSONException {
		JSONObject json = new JSONObject();

		json.put("contactid", this.getContactid());
		json.put("contactname", this.getContactname());
		json.put("relationship", this.getRelationship());
		json.put("phone", this.getPhone());
		json.put("email", this.getEmail());
		json.put("userid", this.getUserid());
		return json;

	}

}
